package nl.janvanloenen.bkc;

public class Match {
	
	//private variables
	private int _id;
	private String _teama;
	private String _teamb;
	private String _date;
	private long _starttime;
	private long _endtime;
	private int _scoreteama;
	private int _scoreteamb;
	private State _state;
	
	// Empty constructor
	public Match(){
		
	}
	// constructor
	public Match(int id, String teama, String teamb, String date, int startTime, int endTime, int scoreTeamA, int scoreTeamB, String state){
		this._id = id;
		this._teama = teama;
		this._teamb = teamb;
		this._date = date;
		this._starttime = startTime;
		this._endtime = endTime;
		this._scoreteama = scoreTeamA;
		this._scoreteamb = scoreTeamB;
		this._state = State.valueOf(state);
	}
	
	// constructor
	public Match(String teama, String teamb, String date, long startTime, long endTime, int scoreTeamA, int scoreTeamB, String state){
		this._teama = teama;
		this._teamb = teamb;
		this._date = date;
		this._starttime = startTime;
		this._endtime = endTime;
		this._scoreteama = scoreTeamA;
		this._scoreteamb = scoreTeamB;
		this._state = State.valueOf(state);
	}
	// getting ID
	public int getID(){
		return this._id;
	}
	
	// setting id
	public void setID(int id){
		this._id = id;
	}
	
	// getting team A
	public String getTeamA(){
		return this._teama;
	}
	
	// setting team A
	public void setTeamA(String team){
		this._teama = team;
	}
	
	// getting team B
	public String getTeamB(){
		return this._teamb;
	}
	
	// setting team B
	public void setTeamB(String team){
		this._teamb = team;
	}
	
	// getting date
	public String getDate(){
		return this._date;
	}
	
	// setting date
	public void setDate(String date){
		this._date = date;
	}
	
	// getting start time
	public long getStartTime(){
		return this._starttime;
	}
	
	// setting start time
	public void setStartTime(long time){
		this._starttime = time;
	}
	
	// getting end time
	public long getEndTime(){
		return this._endtime;
	}
	
	// setting end time
	public void setEndTime(long time){
		this._endtime = time;
	}
	
	//set score Team A
	public void setScoreTeamA(int score){
		this._scoreteama = score;
	}
	
	//get score team A
	public int getScoreTeamA(){
		return this._scoreteama;
	}
	
	//set score Team B
	public void setScoreTeamB(int score){
		this._scoreteamb = score;
	}
	
	//get score team B
	public int getScoreTeamB(){
		return this._scoreteamb;
	}
	
	//set state
	public void setState(State state){
		this._state = state;
	}
	
	// get state
	public State getState(){
		return this._state;
	}
	
	public void printMatch(){
		System.out.println(this._teama);
		System.out.println(this._teamb);
		System.out.println(this._date);
		System.out.println(this._starttime);
		System.out.println(this._endtime);
		System.out.println(this._scoreteama);
		System.out.println(this._scoreteamb);
		System.out.println(this._state);
	}
	
	public enum State{
		NEW,
		UPDATE,
		UPTODATE
	}
}
